package CustomUI;

import com.ydev.graphics.animations.R;

import android.R.bool;
import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.view.Window;
import android.view.WindowManager.LayoutParams;
import android.widget.CheckBox;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.TextView;

public class BrushPropertiesDialog extends Dialog {

	SeekBar skWidth=new SeekBar(getContext());
	TextView tvWidth=new TextView(getContext());
	 CheckBox chFill;
	public BrushPropertiesDialog(Context context) {
		super(context);
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		this.setContentView(R.layout.brush_properties_dialog);
		this.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
		LayoutParams params = getWindow().getAttributes();
        params.width = LayoutParams.FILL_PARENT;
        getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
        
        tvWidth=(TextView)findViewById(R.id.tVWidth);
        
        chFill=(CheckBox)findViewById(R.id.checkBoxFill);
        
        skWidth=(SeekBar)findViewById(R.id.skWidth);
        skWidth.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
			
			@Override
			public void onStopTrackingTouch(SeekBar seekBar) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void onStartTrackingTouch(SeekBar seekBar) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void onProgressChanged(SeekBar seekBar, int progress,
					boolean fromUser) {
				tvWidth.setText((skWidth.getProgress()+1)+"");
				
			}
		});
	}

	public int getBrushWidth() {
		
		return skWidth.getProgress()+1;
	}
	
	public boolean getFillProperty(){
		return chFill.isChecked();
	}
	

}
